Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Reading the database metaschema data

Next, take a look at the getListItems procedure, which populates the combo boxes and the selection list in the window.

This procedure is run, for example, to populate the list of fields for a selected database table. It receives the filename or filenames and a query definition as input parameters.

This is an opportunity to share a bit of information about how Progress defines tables and fields in its database. All these definitions are stored in a set of database tables called the metaschema. These tables hold all the information about the database tables that make up your application. All these special table names begin with an underscore (_), which is not valid for your application tables and helps distinguish them from ordinary database tables:

For example, when you select the Customer table in the window, getListItems is run with this table list and query selection:

The _File and _Field tables are joined using a field in the _Field table called _File-Recid and the RECID of the _File record. The RECID is an integer Progress record identifier that was used in earlier times as the standard way to uniquely identify a database record. It has since been superceded by the RowID that you’ve been introduced to in this book, which is more portable to other databases and has other advantages. In any case, the RECID still exists and is used as the mechanism for joining tables in the metaschema. You should avoid using it in application code because the RowID is now the preferred row identifier. The _sys-field field tells you if this is flagged as a system field that isn’t intended to be seen as part of the application information.

There’s just one more piece of information to share about the metaschema tables. Each _File record has a _File-Num field. For tables that are part of your application schema, the _File-Num is greater than 0 and less than 32K. For metaschema tables, the _File-Num is less than 0. For virtual system tables, which you can learn more about in the database administration documentation, the _File-Num is greater than 32K. This also helps identify which tables are specific to your application and which are the support tables Progress uses to manage your application tables.

Knowing about the metaschema tables can help you understand the relational database structure better, and can be useful in cases where you want to browse or display all the tables in your database. However, using this information is only for advanced users and for special situations like this example.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095